#!/usr/bin/python3
from collections import Counter

import sys


def plzg(x):
    b = (Counter(x).most_common(3))
    c = list(b[0])[0]
    d = list(b[1])[0]
    e = list(b[2])[0]
    f = list(b[0])[1]
    g = list(b[1])[1]
    h = list(b[2])[1]
    return c, d, e, f, g, h


try:
    ret = []
    t = int(input())
    if t < 1 or t > 20:
        sys.exit(0)
    for n1 in range(t):
        sr = [int(item) for item in input().split()]
        stu_nums = int(sr[0])
        rate = int(sr[1])
        course = []
        course2 = []

        course01 = []
        course21 = []

        course22 = []

        course23 = []

        for i in range(stu_nums):
            ai = [int(item) for item in input().split()]

            course2.append(ai[0])
            course2.append(ai[1])
            course2.append(ai[2])
            course2.append(ai[3])
            course2.append(ai[4])
            course.append([ai[0], ai[1], ai[2], ai[3], ai[4]])

        out1 = plzg(course2)
        fh1 = out1[0]
        fh2 = out1[1]
        fh3 = out1[2]
        fh5n = out1[5]
        if fh5n / stu_nums < rate / 100:
            ret.append('no')
            continue

        for ii in course:
            if fh1 in ii:
                course21.append(ii[0])
                course21.append(ii[1])
                course21.append(ii[2])
                course21.append(ii[3])
                course21.append(ii[4])
        out1 = plzg(course21)
        fh5n = out1[5]
        if fh5n / stu_nums > rate / 100:
            ret.append('yes')
            continue

        for iii in course:
            if fh2 in iii:
                course22.append(iii[0])
                course22.append(iii[1])
                course22.append(iii[2])
                course22.append(iii[3])
                course22.append(iii[4])
        out1 = plzg(course22)
        fh5n = out1[5]
        if fh5n / stu_nums > rate / 100:
            ret.append('yes')
            continue

        for iiii in course:
            if fh3 in iiii:
                dw1 = int(iiii[0])
                dw2 = int(iiii[1])
                dw3 = int(iiii[2])
                dw4 = int(iiii[3])
                dw5 = int(iiii[4])
                course23.append(iiii[0])
                course23.append(iiii[1])
                course23.append(iiii[2])
                course23.append(iiii[3])
                course23.append(iiii[4])
        out1 = plzg(course23)
        fh5n = out1[5]
        if fh5n / stu_nums > rate / 100:
            ret.append('yes')
        else:
            ret.append('no')
    for i in ret:
        print(i)

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
